;;; GNU Guix --- Functional package management for GNU
;;;
;;; Copyright © 2022 (unmatched parenthesis <paren@disroot.org>
;;; Copyright © 2022 Charles Jackson <charles.b.jackson@protonmail.com>
;;; Copyright © 2022 jgart <jgart@dismail.de>
;;;
;;; This file is not part of GNU Guix.
;;;
;;; GNU Guix is free software; you can redistribute it and/or modify it
;;; under the terms of the GNU General Public License as published by
;;; the Free Software Foundation; either version 3 of the License, or (at
;;; your option) any later version.
;;;
;;; GNU Guix is distributed in the hope that it will be useful, but
;;; WITHOUT ANY WARRANTY; without even the implied warranty of
;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
;;; GNU General Public License for more details.
;;;
;;; You should have received a copy of the GNU General Public License
;;; along with GNU Guix.  If not, see <http://www.gnu.org/licenses/>.

(define-module (guixrus packages common lisp)
  #:use-module (gnu packages)
  #:use-module ((guix licenses) #:prefix license:)
  #:use-module (guix packages)
  #:use-module (gnu packages audio)
  #:use-module (gnu packages c)
  #:use-module (gnu packages gcc)
  #:use-module (gnu packages lisp-xyz)
  #:use-module (gnu packages lisp-check)
  #:use-module (gnu packages linux)
  #:use-module (gnu packages music)
  #:use-module (guix download)
  #:use-module (guix git-download)
  #:use-module (guix utils)
  #:use-module (guix build utils)
  #:use-module (guix build-system asdf)
  #:use-module (srfi srfi-1)
  #:use-module (srfi srfi-19))

(define-public sbcl-rollbar
  (let ((commit "fbaf644e3a0b077f6853d25874de6a5827b4094c")
        (revision "0"))
    (package
      (name "sbcl-rollbar")
      (version "0.0.2")
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/adventuring/rollbar.lisp")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32 "01lax9qkb4xcd56ck88ickgpisw30zwg0s3y7rm6cnxv4qgamhzg"))))
      (build-system asdf-build-system/source) ; FIXME?
      (inputs
        (list sbcl-alexandria
              sbcl-drakma
              sbcl-jonathan
              sbcl-trivial-backtrace))
      (home-page "https://github.com/adventuring/rollbar.lisp")
      (synopsis "Rollbar.com interface for Common Lisp")
      (description
  "Rollbar.com is a service for collecting automated telemetry (ie, bug
  reports, mostly) through their web service.")
      (license license:bsd-3))))

(define-public sbcl-fwoar-lisputils
  (let ((commit "ea2e6a55ef097e14b97cb40f155dec19601ff9e9")
        (revision "0"))
    (package
      (name "sbcl-fwoar-lisputils")
      (version "0.4.2")
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://github.com/fiddlerwoaroof/fwoar.lisputils")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32 "00j6fbq779b8pg5ismaisgf267qlzdwcxww2bsn1114aaqmnjzmr"))))
      (build-system asdf-build-system/source) ; FIXME
      (inputs
        (list
          sbcl-anaphora
          sbcl-alexandria
          sbcl-cl-containers
          sbcl-closer-mop
          sbcl-iterate))
      (home-page "https://github.com/fiddlerwoaroof/fwoar.lisputils")
      (synopsis "Hodgepodge of useful Lisp snippets")
      (description "A hodgepodge of useful Lisp snippets.")
      (license license:expat))))

(define-public sbcl-fare-memoization
  (let ((commit "8b43ac6bcc0057d1a92052e39b6d34c05c2eb7e4")
        (revision "0"))
    (package
      (name "sbcl-fare-memoization")
      (version (git-version "0.0.0" revision commit))
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://gitlab.common-lisp.net/frideau/fare-memoization")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32 "1blmrb4c9gsxj87scz74z1s8w9d1w2r48fyxj0y1sw3vr6bsbb8f"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       '(#:asd-systems '("fare-memoization")))
      (native-inputs
        (list sbcl-hu.dwim.stefil))
      (home-page "https://gitlab.common-lisp.net/frideau/fare-memoization")
      (synopsis "Memoization library for common-lisp")
      (description
"The @code{fare-memoization} library builds on an age-old idea:
dynamically memoizing Lisp functions.  A memoized function remembers
results from previous computations, and returns cached results when called
with the same arguments again, rather than re-doing the computation.")
      (license license:expat))))

(define-public cl-fare-memoization
  (sbcl-package->cl-source-package sbcl-fare-memoization))

(define-public ecl-fare-memoization
  (sbcl-package->ecl-package sbcl-fare-memoization))

(define-public sbcl-scribble
  (let ((commit "4e5369bec6d5e4eed4f99c3dc009fce3e3427cd3")
        (revision "0"))
    (package
      (name "sbcl-scribble")
      (version "0.4.2")
      (source
        (origin
          (method git-fetch)
          (uri (git-reference
                (url "https://gitlab.common-lisp.net/frideau/scribble")
                (commit commit)))
          (file-name (git-file-name name version))
          (sha256
           (base32 "056qi6vw9bk19s42mapyg55mimhhvhlwgny080v9mhv4fhnqi196"))))
      (build-system asdf-build-system/sbcl)
      (native-inputs
        (list sbcl-babel))
      (inputs
        (list sbcl-fare-utils
              ;; sbcl-fare-matcher
              sbcl-fare-memoization
              sbcl-fare-quasiquote
              sbcl-meta
              sbcl-named-readtables))
      (home-page "https://gitlab.common-lisp.net/frideau/scribble")
      (synopsis "SCRibe-like reader extension for Common Lisp")
      (description "SCRibe-like reader extension for Common Lisp.")
      (license license:llgpl))))

(define-public cl-scribble
  (sbcl-package->cl-source-package sbcl-scribble))

(define-public ecl-scribble
  (sbcl-package->ecl-package sbcl-scribble))

(define-public sbcl-cxp
  (let ((commit "cdea8984d7dcf7fa075200973482bf9a27341003")
        (revision "0"))
    (package
     (name "sbcl-cxp")
     (version (git-version "20220221" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://git.sr.ht/~ilmu/cxp")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1cb0pg2a7j583dymnrlbb8xa2n1pka5p5bh82rpjqm4d30lyalx0"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:tests? #f ; There are no tests.
        #:asd-systems '("cxp")))
     (inputs
      `(("cl-ppcre" ,cl-ppcre)
        ("cl-str" ,cl-str)
        ("cl-chanl" ,cl-chanl)
        ("cl-alexandria" ,cl-alexandria)
        ("cl-trivia" ,cl-trivia)))
     (synopsis "Simple pipeline components built on canonical S-expressions.")
     (description
"A modern take on line editors; cxp offers various ways to break a
text file into snippets, rearrange the snippets and then reassemble the
text file.  The cxp dsl is based on string diagrams and has experimental
datalisp name system features.")
     ;; Home page is on a Distributed Web Gateway for IPFS provided
     ;; by Cloudflare.
     (home-page "http://datalisp.is")
     (license license:bsd-3))))

(define-public cl-cxp
  (sbcl-package->cl-source-package sbcl-cxp))

(define-public ecl-cxp
  (sbcl-package->ecl-package sbcl-cxp))

(define-public sbcl-variatio
  (let ((commit "6991bf3e810c4fd11523550a563645dad1ba333f")
        (revision "0"))
    (package
     (name "sbcl-variatio")
     (version (git-version "0.0.0" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/ntrocado/variatio")
               (commit commit)))
         (file-name (git-file-name name version))
         (modules '((guix build utils)))
         (snippet
           '(begin
              ;; delete debian and roswell files/scripts
              (delete-file-recursively "bin")
              (delete-file "Aptfile")))
         (sha256
          (base32 "0rvsngm4pk0yvxsaagcckyk2ih0jp7r0jx6cxw64ql02rx3ddp1p"))))
     (build-system asdf-build-system/sbcl)
     (inputs
       (list lilypond
             sbcl-hunchentoot
             sbcl-alexandria
             sbcl-parenscript
             sbcl-cl-ppcre
             sbcl-cl-who
             sbcl-parse-float))
     (arguments
      '(#:tests? #f
        #:asd-systems '("variatio")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-lilypond-executable
            (lambda _
              (substitute* "variatio.lisp"
                (("/app/.apt/usr/bin/lilypond.real") (which "lilypond"))))))))
     (synopsis "Generate variations on a musical phrase")
     (description
"@code{variatio} is a web app that generates variations from a
given initial musical phrase.  A textual mini-language is defined for
the input.  The variations are obtained from a series of algorithmic
transformations.  The user is then offered a pdf score with the results.")
     (home-page "http://variatio.nunotrocado.com/")
     (license license:llgpl))))

(define-public cl-variatio
  (sbcl-package->cl-source-package sbcl-variatio))

(define-public ecl-variatio
  (sbcl-package->ecl-package sbcl-variatio))

(define-public sbcl-mondo
  (let ((commit "0c05a7e53ea0b6551dab90a247e9a42ebda8dca7")
        (revision "0"))
    (package
     (name "sbcl-mondo")
     (version (git-version "0.0.0" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/fukamachi/mondo")
               (commit commit)))
         (file-name (git-file-name name version))
         (modules '((guix build utils)))
         (snippet
           '(begin
              ;; delete roswell script
              ;; how to build an executable?
              ;; https://github.com/koji-kojiro/cl-repl/issues/19
              (delete-file-recursively "roswell")))
         (sha256
          (base32 "1dlza3px0876svs65rifc4hvx1mg1izgb33zkg54yrckvkwjw5z2"))))
     (build-system asdf-build-system/sbcl)
     (native-inputs
       (list sbcl-rove
             sbcl-cl-interpol))
     (inputs
       (list sbcl-cl-readline
             sbcl-usocket
             sbcl-alexandria
             sbcl-bordeaux-threads
             sbcl-slime-swank
             sbcl-babel))
     (arguments
      '(#:asd-systems '("mondo" "mondo/command" "mondo/tests")
        #:phases
        (modify-phases %standard-phases
          (add-after 'create-asdf-configuration 'make-cli-executable
            (lambda* (#:key outputs #:allow-other-keys)
              (build-program
                (string-append (assoc-ref outputs "out") "/bin/mondo")
                outputs
                #:dependencies '("mondo/command")
                #:entry-program '("mondo/cli:main")))))))
     (synopsis "Common Lisp REPL interface")
     (description
"@code{cl-mondo} is a simple Common Lisp REPL, just like the SLIME REPL
that works on the terminal.")
     (home-page "https://github.com/fukamachi/mondo/")
     (license license:gpl3+))))

(define-public cl-mondo
  (sbcl-package->cl-source-package sbcl-mondo))

(define-public ecl-mondo
  (sbcl-package->ecl-package sbcl-mondo))

(define-public sbcl-lacrida
  (let ((commit "8ad8cece447e6503a6e689d4e42a835fef07bbc7")
        (revision "0"))
    (package
     (name "sbcl-lacrida")
     (version (git-version "0.0.0" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/thrig/lacrida")
               (commit commit)))
         (file-name (git-file-name name version))
         (snippet
           '(begin
              ;; delete quicklisp scripts
              (delete-file "compile")
              (delete-file "run")))
         (sha256
          (base32 "0skngjmk4zxhmf06b6zk7c49c9i3kq9gkh7252r9670cd1li9pf1"))))
     (build-system asdf-build-system/sbcl)
     (inputs
       (list sbcl-cl-charms
             sbcl-alexandria))
     (arguments
      '(#:tests? #f ; no tests
        #:asd-systems '("lacrida")))
     (synopsis "Spring Lisp Game Jam 2020 game")
     (description
"@code{cl-lacrida} is a computer fantasy game.  The object of the game
is to obtain food scattered throughout the garden of some Wizard, and
to ideally escape unharmed.")
     (home-page "https://github.com/thrig/lacrida/")
     (license license:isc))))

(define-public cl-lacrida
  (sbcl-package->cl-source-package sbcl-lacrida))

(define-public ecl-lacrida
  (sbcl-package->ecl-package sbcl-lacrida))

(define-public sbcl-osc
  (let ((commit "e1ac269e257c642032881237af015aae86e698ec")
        (revision "0"))
    (package
     (name "sbcl-osc")
     (version (git-version "20220205" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/zzkt/osc")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1808w72d2bbnc7n75aap1lhyai8lp0100h80a2lhjcx6wl0z1lvl"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:tests? #f ; There are no tests.
        #:asd-systems '("osc")))
     (synopsis "Common lisp implementation of the Open Sound Control protocol")
     (description
"@code{cl-osc} is a common lisp implementation of the Open Sound Control
Protocol aka OSC.  The code should be close to the ansi standard, and
does not rely on any external code/ffi/etc+ to do the basic encoding
and decoding of packets.")
     (home-page "https://github.com/zzkt/osc/")
     (license license:llgpl))))

(define-public cl-osc
  (sbcl-package->cl-source-package sbcl-osc))

(define-public ecl-osc
  (sbcl-package->ecl-package sbcl-osc))

(define-public sbcl-cl-collider
  (let ((commit "fbf85e933bc688d0388309a964ca515008fb1805")
        (revision "0"))
    (package
     (name "sbcl-cl-collider")
     (version (git-version "2018.7.15" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/byulparan/cl-collider")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0czq8r6v5sm6pb3kk33ajv7hhk3z9agykwgl93s2xdlgl3x1h3rv"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:tests? #f ; There are no tests.
        #:asd-systems '("cl-collider" "sc-osc")
        #:phases
        (modify-phases %standard-phases
          (add-after 'unpack 'patch-supercollider-executable
            (lambda _
              (substitute* "server.lisp"
                (("which scsynth") (which "scsynth"))
                (("jack_connect") (which "jack_connect"))))))))
     (inputs
       (list supercollider
             jack-2
             sbcl-osc
             sbcl-alexandria
             sbcl-cffi
             sbcl-bordeaux-threads
             sbcl-pileup
             sbcl-flexi-streams
             sbcl-split-sequence
             sbcl-named-readtables
             sbcl-simple-inferiors
             sbcl-cl-ppcre
             sbcl-ieee-floats ; sc-osc dependencies
             sbcl-usocket))
     (synopsis "SuperCollider client for CommonLisp")
     (description
"@code{cl-cl-collider} is a @code{supercollider} client for CommonLisp.")
     (home-page "https://github.com/byulparan/cl-collider/")
     (license license:public-domain))))

(define-public cl-collider
  (sbcl-package->cl-source-package sbcl-cl-collider))

(define-public ecl-cl-collider
  (sbcl-package->ecl-package sbcl-cl-collider))

(define-public sbcl-cl-gendoc
  (let ((commit "c8fed7dd008a0cc34138521e45116e063aea33bd")
        (revision "0"))
    (package
     (name "sbcl-cl-gendoc")
     (version (git-version "1.0" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/chfin/cl-gendoc")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "19f8fmz2hj332kh3y3fbil2dchpckdsqci6ljhadymd8p2h6w4ws"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:tests? #f ; There are no tests.
        #:asd-systems '("cl-gendoc" "cl-gendoc-docs")))
     (inputs
       (list sbcl-cl-who sbcl-3bmd))
     (synopsis "Simple component-based documentation generator")
     (description
"@code{cl-gendoc} is a simple component-based documentation generator.")
     (home-page "https://github.com/chfin/cl-gendoc/")
     (license license:expat))))

(define-public cl-gendoc
  (sbcl-package->cl-source-package sbcl-cl-gendoc))

(define-public ecl-cl-gendoc
  (sbcl-package->ecl-package sbcl-cl-gendoc))

(define-public sbcl-date-time-parser
  (let ((commit "00d6fc70b599f460fdf13cf0cf7e6bf843312410")
        (revision "0"))
    (package
     (name "sbcl-date-time-parser")
     (version (git-version "1.03" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/chfin/cl-date-time-parser")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0dswpbbb57jm609xxfah25dxxhjzc7qh5lr1a1ffkpms84l0r7m5"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:tests? #f ; There are no tests.
        #:asd-systems '("cl-date-time-parser")))
     (inputs
       (list
         sbcl-alexandria
         sbcl-split-sequence
         sbcl-anaphora
         sbcl-cl-ppcre
         sbcl-local-time
         sbcl-parse-float))
     (synopsis "Parse date-time-string, liberally")
     (description
"The goal of @code{cl-date-time-parser} is to hide the difference
between date-time formats, and to manage date and time as the
universal time.")
     (home-page "https://github.com/chfin/cl-date-time-parser/")
     (license license:expat))))

(define-public cl-date-time-parser
  (sbcl-package->cl-source-package sbcl-date-time-parser))

(define-public ecl-date-time-parser
  (sbcl-package->ecl-package sbcl-date-time-parser))

(define-public sbcl-ratify
  (let ((commit "5cb1471ff93b8ab45f343e548666d2effc1efc67")
        (revision "0"))
    (package
     (name "sbcl-ratify")
     (version (git-version "0.1.0" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/Shinmera/ratify")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0lhz3g85sc8ral59bs6g32f9nvxvbz126wchr8c3f5jj95xhngma"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:tests? #f ; There are no tests.
        #:asd-systems '("ratify")))
     (inputs
       (list sbcl-cl-ppcre
             sbcl-local-time
             sbcl-parse-float))
     (synopsis "Collection of utilities to ratify, validate and parse inputs")
     (description
"@code{cl-ratify} is a collection of utilities to perform
validation checks and parsing.  The main intention of usage for this is
in web-applications in order to check form inputs for correctness and
automatically parse them into their proper representations or return
meaningful errors.")
     (home-page "https://shinmera.github.io/ratify/")
     (license license:zlib))))

(define-public cl-ratify
  (sbcl-package->cl-source-package sbcl-ratify))

(define-public ecl-ratify
  (sbcl-package->ecl-package sbcl-ratify))

(define-public sbcl-planks
  (let ((commit "ac600345ac5f01b1610720a69bfe57953dfb5695")
        (revision "0"))
    (package
     (name "sbcl-planks")
     (version (git-version "20110502" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/drewc/planks")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "138vlmi1ixkj60np3jmnb57cz2bn2x2fihm16gryb1r93r6scx56"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:tests? #f ; There are no tests.
        #:asd-systems '("planks")))
     (inputs
       (list sbcl-rucksack
             sbcl-ironclad
             sbcl-bordeaux-threads
             sbcl-trivial-garbage
             sbcl-babel
             sbcl-closer-mop))
     (synopsis "Functional utilities for Common Lisp")
     (description
"The @code{cl-planks} library provides a language for expressing data
manipulations as the composition of more primitive operations.")
     (home-page "https://drewc.github.io/planks/")
     (license license:expat))))

(define-public cl-planks
  (sbcl-package->cl-source-package sbcl-planks))

(define-public ecl-planks
  (sbcl-package->ecl-package sbcl-planks))

(define-public sbcl-lass
  (let ((commit "a7a4452f6a670b8fb01a73d3007030d16bd1ec2c")
        (revision "0"))
    (package
     (name "sbcl-lass")
     (version (git-version "20210902" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/Shinmera/LASS")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "06wds1qzj8s862pmmza1427n7gdpplqplxqnxyqkrr0hgxdl4xbf"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:asd-systems '("lass")))
     (inputs
       (list sbcl-trivial-indent
             sbcl-trivial-mimes
             sbcl-cl-base64))
     (synopsis "Lisp Augmented Style Sheets")
     (description
"Writing CSS files comes with a lot of repetition and is generally much
too verbose.  With lispy syntax, shortcuts, and improvements, LASS aims
to help you out in writing CSS quick and easy.  LASS was largely inspired
by SASS.")
     (home-page "https://shinmera.github.io/LASS/")
     (license license:expat))))

(define-public cl-lass
  (sbcl-package->cl-source-package sbcl-lass))

(define-public ecl-lass
  (sbcl-package->ecl-package sbcl-lass))

(define-public sbcl-trivial-irc
  (let ((commit "7cb6e99e68c5391a31c693fcc65144d74ed4063a")
        (revision "0"))
    (package
     (name "sbcl-trivial-irc")
     (version (git-version "20210902" revision commit))
     (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/tstenhaug/trivial-irc")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0jjgx6ld2gcr0w0g5k62dr0rl6202ydih6ylmypv6m5jmrarcbza"))))
     (build-system asdf-build-system/sbcl)
     (arguments
      '(#:asd-systems '("trivial-irc" "trivial-irc-echobot")))
     (inputs
       (list sbcl-cl-ppcre
             sbcl-split-sequence
             sbcl-usocket))
     (synopsis "Trivial IRC client library for Common Lisp")
     (description
"@code{cl-trivial-irc} is a an IRC client library with simple facilities
for receiving, handling and sending messages, and without facilities
for CTCP.")
     (home-page "https://github.com/tstenhaug/trivial-irc/")
     (license license:expat))))

(define-public cl-trivial-irc
  (sbcl-package->cl-source-package sbcl-trivial-irc))

(define-public ecl-trivial-irc
  (sbcl-package->ecl-package sbcl-trivial-irc))

(define-public sbcl-lisp-stat
  (let ((commit "ff57cd5636de240c4b4976d095c9c29c4ea061d1")
        (revision "0"))
    (package
      (name "sbcl-lisp-stat")
      (version (git-version "0.3.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/Lisp-Stat/lisp-stat")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "0xh9z5qn4308qg681805zg8bxv715z9rix9fpd2r5rm88bzx3dp2"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       '(#:tests? #f ; fixme
         #:asd-systems '("lisp-stat" ))) ; There are no tests.
      (inputs
        (list sbcl-alexandria
              sbcl-let-plus
              sbcl-array-operations
              sbcl-data-frame
              sbcl-dfio
              sbcl-numerical-utilities
              sbcl-select
              sbcl-dexador
              sbcl-split-sequence))
      (native-inputs
        (list sbcl-parachute))
      (home-page "https://lisp-stat.github.io/lisp-stat")
      (synopsis "Statistical computing environment for Common Lisp")
      (description
"@code{cl-lisp-stat} provides support for vectorized mathematical
operations, and a comprehensive set of statistical methods that are
implemented using the latest numerical algorithms.  In addition,
Common Lisp provides a dynamic programming environment, an excellent
object-oriented facility and meta-object protocol.")
      (license license:gpl3+))))

(define-public cl-lisp-stat
  (sbcl-package->cl-source-package sbcl-lisp-stat))

(define-public ecl-lisp-stat
  (sbcl-package->ecl-package sbcl-lisp-stat))

(define-public sbcl-cephes
  (let ((commit "d87146fa38c8425ffb5fe425eee5eb3e818bacd4")
        (revision "0"))
    (package
      (name "sbcl-cephes")
      (version (git-version "1.2" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/Lisp-Stat/cephes.cl")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "09adls1lwwzwm1jmvhf11arwlsy5w0bi2rmniahas824mysv77lr"))))
      (build-system asdf-build-system/sbcl)
      (inputs
        (list sbcl-cffi))
      (home-page "https://lisp-stat.github.io/cephes.cl/")
      (synopsis "Common Lisp wrapper for the Cephes Mathematical Library")
      (description
"This package provides a common lisp CFFI wrapper for the SciPy version
of Cephes special functions.")
      (license license:ms-pl))))

(define-public cl-cephes
  (sbcl-package->cl-source-package sbcl-cephes))

(define-public ecl-distributions
  (sbcl-package->ecl-package sbcl-cephes))

(define-public sbcl-data-frame
  (let ((commit "e094a181d08163244a77fac7750ffa0385e9d798")
        (revision "0"))
    (package
      (name "sbcl-data-frame")
      (version (git-version "0.3.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/Lisp-Stat/data-frame")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1rq51dbhjzjm1vicjq7sps21i0wvl27m0x17qykx8qjnmg7np0va"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       '(#:tests? #f
         #:asd-systems '("data-frame" ))) ; There are no tests.
      (inputs
        (list sbcl-alexandria
              sbcl-serapeum ; https://github.com/Lisp-Stat/data-frame/pull/12
              sbcl-anaphora
              sbcl-let-plus
              sbcl-alexandria-plus
              sbcl-array-operations
              sbcl-numerical-utilities
              sbcl-select))
      (native-inputs
        (list sbcl-clunit2))
      (home-page "https://data-frame.github.io/data-frame")
      (synopsis "Data frames for Common Lisp")
      (description
"@code{cl-data-frame} is a data manipulation package, conceptually
similar to R's data.frame.")
      (license license:ms-pl))))

(define-public cl-data-frame
  (sbcl-package->cl-source-package sbcl-data-frame))

(define-public ecl-data-frame
  (sbcl-package->ecl-package sbcl-data-frame))

(define-public sbcl-dfio
  (let ((commit "f7984b792bf4d9010083db08472bc84d2d31430c")
        (revision "0"))
    (package
      (name "sbcl-dfio")
      (version (git-version "0.3.0" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/Lisp-Stat/dfio")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1wka8y4526x8yy3asiy15jxdzhsmyiq6ra6wbi8a4vcry3g2v9a0"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       '(#:asd-systems '("dfio" "dfio/json" "dfio/tests"))) ; There are no tests.
         ;; dfio/json
      (inputs
        (list sbcl-alexandria
              sbcl-anaphora
              sbcl-data-frame
              sbcl-yason
              sbcl-dexador
              sbcl-fare-csv ; not packaged
              sbcl-let-plus))
      (native-inputs
        (list sbcl-clunit2))
      (home-page "https://dfio.github.io/dfio")
      (synopsis "Read data to and from data frames")
      (description
"Data frames are not of much use if you have to type all the data in by hand.
This system provides I/O functions to read data sets from delimited (CSV, TSV,
etc) files.  The file may either be on a local disk or accessible from a
network.")
      (license license:ms-pl))))

(define-public cl-dfio
  (sbcl-package->cl-source-package sbcl-dfio))

(define-public ecl-dfio
  (sbcl-package->ecl-package sbcl-dfio))

(define-public sbcl-fare-csv
  (let ((commit "39fcada5db2899af172454899ff13a07c62ebdb9")
        (revision "0"))
    (package
      (name "sbcl-fare-csv")
      (version (git-version "20151210" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/fare/fare-csv")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "09iq4mfvqlgfcj8gazdwr8y03jrh10aa2y847sz46wdnr2bkys00"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       '(#:tests? #f ; fixme
         #:asd-systems '("fare-csv")))
      (home-page "https://fare-csv.github.io/fare-csv")
      (synopsis "Read data to and from data frames")
      (description
"@code{fare-csv} allows you to read and write CSV files, according to any of the
prevailing standards and their popular variants.")
      (license license:ms-pl))))

(define-public cl-fare-csv
  (sbcl-package->cl-source-package sbcl-fare-csv))

(define-public ecl-fare-csv
  (sbcl-package->ecl-package sbcl-fare-csv))

(define-public sbcl-azure
  (let ((commit "03b097256d85ea09f090987c0c833c61eb7b9b5d")
        (revision "0"))
    (package
      (name "sbcl-azure")
      (version (git-version "0.2.1" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://github.com/RobBlackwell/cl-azure")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "19sgzbvgs1f1h3qhx11xhpia2x3n8x729h9fsqkc7fap0ak1h31d"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       '(#:tests? #f ; There are no tests.
         #:asd-systems '("cl-azure")))
      (inputs
        (list sbcl-drakma
              sbcl-ironclad
              sbcl-cxml
              sbcl-cl-base64
              sbcl-babel
              sbcl-cl-ppcre
              sbcl-puri
              sbcl-cl-json
              sbcl-rt))
      (home-page "https://github.com/RobBlackwell/cl-azure/")
      (synopsis "Windows Azure cloud services library for Common Lisp")
      (description
"@code{cl-azure} provides a library to access Microsoft Windows Azure
cloud services from Common Lisp.")
      (license license:expat))))

(define-public cl-azure
  (sbcl-package->cl-source-package sbcl-azure))

(define-public ecl-azure
  (sbcl-package->ecl-package sbcl-azure))

(define-public sbcl-clm
  (package
    (name "sbcl-clm")
    (version "5")
    (source
     (origin
       (method url-fetch)
       (uri "https://ccrma.stanford.edu/software/clm/clm-5.tar.gz")
       (sha256
        (base32 "1ckgl7rsnxppnf47jqayrbyhm3hv6c4f7n2994ylva6wiy5w7wp8"))))
    (build-system asdf-build-system/sbcl)
    (native-inputs
     `(("gcc" ,gcc)))
    (inputs
     `(("alsa-lib" ,alsa-lib)))
    (arguments
     `(#:phases
       (modify-phases %standard-phases
         (add-after 'unpack 'fix-build
           (lambda _
             (substitute* "configure"
               (("/bin/sh")
                (which "bash")))
             (substitute* '("all.lisp"
                            "index.cl"
                            "initmus.lisp")
               (("/bin/csh")
                (which "bash")))
             (substitute* "all.lisp"
               (("#\\sbcl \\(shadowing-import 'clm:double\\)" all)
                (string-append all
                               " #sbcl (shadowing-import 'clm:env)"))))))))
    (home-page "https://ccrma.stanford.edu/software/clm/")
    (synopsis "Music synthesis and signal processing package")
    (description
"Common Lisp Music is a music synthesis and signal processing package
in the Music V family.")
    (license license:expat)))

(define-public cl-clm
  (sbcl-package->cl-source-package sbcl-clm))

(define-public sbcl-clones
  (let ((commit "a2f7d84ad6a12c0a33b50a453a377a1fb9e3afac")
        (revision "0"))
    (package
      (name "sbcl-clones")
      (version (git-version "0.1" revision commit))
      (source
       (origin
         (method git-fetch)
         (uri (git-reference
               (url "https://git.sr.ht/~kingcons/clones")
               (commit commit)))
         (file-name (git-file-name name version))
         (sha256
          (base32 "1i0wg6da6svvy0mm8jxgiw6zfs4canmv1bv5dqrbz8l61b3brzgs"))))
      (build-system asdf-build-system/sbcl)
      (arguments
       '(#:tests? #f ; Tests are currently failing at this commit.
         #:asd-systems '("clones" "clones-test")))
      (native-inputs
        (list sbcl-split-sequence
              sbcl-prove))
      (inputs
        (list sbcl-alexandria))
      (home-page "https://git.sr.ht/~kingcons/clones")
      (synopsis "Common Lisp NES Emulator")
      (description "@code{sbcl-clones} is a Common Lisp NES Emulator.")
      (license license:llgpl))))

(define-public cl-clones
  (sbcl-package->cl-source-package sbcl-clones))

(define-public ecl-clones
  (sbcl-package->ecl-package sbcl-clones))
